package com.xiaorun.portal.spider.pipeline;

import com.xiaorun.portal.dao.NoticeMapper;
import com.xiaorun.portal.modal.Vo.Notice;
import org.springframework.stereotype.Component;
import us.codecraft.webmagic.ResultItems;
import us.codecraft.webmagic.Task;
import us.codecraft.webmagic.pipeline.Pipeline;

import javax.annotation.Resource;

@Component
public class NoticePipeline implements Pipeline {

    @Resource
    private NoticeMapper noticeMapper;

    @Override
    public void process(ResultItems resultItems, Task task) {
        Notice notice = resultItems.get("notice");
        noticeMapper.save(notice);

    }

}
